package com.app.datamanagermodule.entity

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey



@Entity(tableName = "_user")
class User {

    @PrimaryKey(autoGenerate = true)
    var id: Long = 0

    var phoneNum: String = ""

    var userName: String = ""

    var age: Int = 0


    override fun toString(): String {
        return "User(id=$id, phoneNum='$phoneNum', userName='$userName', age=$age)"
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as User

        if (id != other.id) return false
        if (phoneNum != other.phoneNum) return false
        if (userName != other.userName) return false
        if (age != other.age) return false

        return true
    }

    override fun hashCode(): Int {
        var result = id.hashCode()
        result = 31 * result + phoneNum.hashCode()
        result = 31 * result + userName.hashCode()
        result = 31 * result + age
        return result
    }


}